package com.llb.ble;

import androidx.appcompat.app.AppCompatActivity;

import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class SetAppActivity extends AppCompatActivity {
    Context context;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().getDecorView().setSystemUiVisibility(View.INVISIBLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_set_app);
        context = this;
    }

    public void saomaqiang(View view) {
        startActivity(new Intent(this,SaoMaqiangActivity.class));
    }

    public void uvc(View view) {
        Toast.makeText(this,"UVC摄像头未接入！",Toast.LENGTH_LONG).show();
    }

    public void fenbianlv(View view) {
        Toast.makeText(this,"当前设备不支持，缺少JNI调用库！",Toast.LENGTH_LONG).show();
    }

    public void histroy(View view) {
        startActivity(new Intent(this,HistroyActivity.class));
    }

    public void shanpin(View view) {
        startActivity(new Intent(this,HistroyActivity.class));
    }

    public void gengxin(View view) {
        Toast.makeText(this,"连接服务器失败，请确认连入局域网",Toast.LENGTH_SHORT).show();
    }

    public void setIP(View view) {
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setTitle("进入设定");
        builder.setMessage("进入设置，输入服务开放的IP与开放的端口号");
        builder.setCancelable(true);
        final AlertDialog setDia = builder.create();
        View dialogView = View.inflate(context, R.layout.activity_custom1, null);
        setDia.setView(dialogView);
        setDia.show();
        final EditText user = dialogView.findViewById(R.id.et_username);
        Button yes =dialogView.findViewById(R.id.btn_yes);
        yes.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                setDia.dismiss();
            }
        });
    }

    public void seshi(View view) {
        
    }
}